/*
 * HubInfo.java
 *
 * Created on 11 September 2006, 17:31
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package libjdc.dc.client;


/**
 *
 * @author root
 */
public class HubInfo {
    
    private String topic;
    private String name;
    private String address;
    private String port;
    private String description;
    private String hub_type;
    private String hubowner;
    private Long max_users;
    private Long min_share;
    private Integer min_slots;
    private Integer max_hubs;
    
    public HubInfo() {
        this.setName("");
        this.setAddress("");
        this.setPort("");
        this.setDescription("");
        this.setHub_type("");
        this.setHubowner("");
        this.setMax_users(new Long(0));
        this.setMin_share(new Long(0));
        this.setMin_slots(new Integer(0));
        this.setMax_hubs(new Integer(0));
    }
    
    /** Creates a new instance of HubInfo */
    public HubInfo
            (String hub_info_name,
            String hub_info_address, 
            String hub_info_port,
            String hub_info_description,
            Long hub_info_max_users,
            Long hub_info_min_share,
            Integer hub_info_min_slots,
            Integer hub_info_max_hubs,
            String hub_info_hub_type,
            String hub_info_hubowner) {
        this.setName(hub_info_name);
        this.setAddress(hub_info_address);
        this.setPort(hub_info_port);
        this.setDescription(hub_info_description);
        this.setHub_type(hub_info_hub_type);
        this.setHubowner(hub_info_hubowner);
        this.setMax_users(hub_info_max_users);
        this.setMin_share(hub_info_min_share);
        this.setMin_slots(hub_info_min_slots);
        this.setMax_hubs(hub_info_max_hubs);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        if(name.indexOf(" - ")!= -1){
            this.name = name.substring(0,name.indexOf(" - "));
            this.topic = name.substring(name.indexOf(" - ")+" - ".length());
        } else
            this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPort() {
        return port;
    }

    public void setPort(String port) {
        this.port = port;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getHub_type() {
        return hub_type;
    }

    public void setHub_type(String hub_type) {
        this.hub_type = hub_type;
    }

    public String getHubowner() {
        return hubowner;
    }

    public void setHubowner(String hubowner) {
        this.hubowner = hubowner;
    }

    public Long getMax_users() {
        return max_users;
    }

    public void setMax_users(Long max_users) {
        this.max_users = max_users;
    }

    public Long getMin_share() {
        return min_share;
    }

    public void setMin_share(Long min_share) {
        this.min_share = min_share;
    }

    public Integer getMin_slots() {
        return min_slots;
    }

    public void setMin_slots(Integer min_slots) {
        this.min_slots = min_slots;
    }

    public Integer getMax_hubs() {
        return max_hubs;
    }

    public void setMax_hubs(Integer max_hubs) {
        this.max_hubs = max_hubs;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

}
